#pragma once
#include "DXAMLCommon.h"

#include "XamlSchemaContext.h"
#include "ObjectWriterStack.h"
#include "INameScope.h"
#include "IPALUri.h"


class XamlSavedContext
{
private: 
	xweak_ptr<XamlSchemaContext> m_spSchemaContext;
	xshared_ptr<ObjectWriterStack> m_spObjectWriterStack;
	xref_ptr<INameScope> m_spRootNamescope;
	xref_ptr<IPALUri> m_spBaseUri;
	xref_ptr<IPALUri> m_spXamlResourceUri;
	XBOOL m_fAllowEvents;
	XamlSavedContext(xshared_ptr<XamlSchemaContext> & spXamlSchemaContext, xshared_ptr<ObjectWriterStack> & spObjectWriterStack, class xref_ptr<INameScope> spRootNamescope, class xref_ptr<IPALUri> spBaseUri, class xref_ptr<IPALUri> spXamlResourceUri, XBOOL fAllowEvents);
public: 
	~XamlSavedContext();
	static HRESULT Create(const xshared_ptr<ObjectWriterContext> & spObjectWriterContext, xshared_ptr<ObjectWriterStack> & spObjectWriterStack, xshared_ptr<XamlSavedContext> & rspXamlSavedContext);
	HRESULT get_SchemaContext(xshared_ptr<XamlSchemaContext> & spSchemaContext);
	HRESULT get_Stack(xshared_ptr<ObjectWriterStack> & rspObjectWriterStack);
	HRESULT get_BaseUri(xref_ptr<IPALUri> & rspBaseUri);
	HRESULT get_XamlResourceUri(xref_ptr<IPALUri> & rspXamlResourceUri);
	HRESULT get_RootNamescope(xref_ptr<INameScope> & spNameScope);
	XBOOL get_AllowEvents() const;
	HRESULT SetLastObject(const xshared_ptr<XamlQualifiedObject> & spObj);
};

